package com.css.fxfzysx.modules.ysxManagement.controller;

import com.css.fxfzysx.base.response.RestResponse;
import com.css.fxfzysx.modules.ysxManagement.entity.RdFactorEntity;
import com.css.fxfzysx.modules.ysxManagement.service.RdFactorService;
import com.css.fxfzysx.modules.ysxManagement.vo.DdRatioVo;
import com.css.fxfzysx.modules.ysxManagement.vo.RdFactorVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 道路计算参数值维护
 */
@RestController
@RequestMapping("rdFactor")
public class RdFactorController {

    @Autowired
    private RdFactorService rdFactorService;

    /**
     * 道路路基路面震害因子量化取值表添加或修改
     * @param
     * @return
     */
    @RequestMapping("saveOrUpdateRdFactor")
    public RestResponse saveOrUpdateRdFactor(@RequestBody List<RdFactorEntity> rdFactorEntityList){
        return rdFactorService.saveOrUpdateRdFactor(rdFactorEntityList);
    }

    /**
     * 道路路基路面震害因子量化取值表查询
     * @param
     * @return
     */
    @GetMapping("getAllRdFactor")
    public RestResponse getAllRdFactor(){
        return rdFactorService.getAllRdFactor();
    }

    /**
     * 道路路基路面震害因子量化取值表删除
     * @param rdFactorIds
     * @return
     */
    @GetMapping("deleteRdFactorById")
    public RestResponse deleteRdFactorById(String rdFactorIds){
        return rdFactorService.deleteRdFactorById(rdFactorIds);
    }

    /**
     * 震害离散系数推荐值表添加或修改
     * @param ddRatioVo
     * @return
     */
    @RequestMapping("saveOrUpdateDdRatio")
    public RestResponse saveOrUpdateDdRatio(@RequestBody DdRatioVo ddRatioVo){
        return rdFactorService.saveOrUpdateDdRatio(ddRatioVo);
    }

    /**
     * 震害离散系数推荐值表查询
     * @param titleName
     * @return
     */
    @GetMapping("getAllDdRatio")
    public RestResponse getAllDdRatio(String titleName){
        return rdFactorService.getAllDdRatio(titleName);
    }

    /**
     * 震害离散系数推荐值表删除
     * @param ddRatioIds
     * @return
     */
    @GetMapping("deleteDdRatioById")
    public RestResponse deleteDdRatioById(String ddRatioIds,String arrangeIds){
        return rdFactorService.deleteDdRatioById(ddRatioIds,arrangeIds);
    }

}
